[Top] [Prev] [Next] [Bottom] [Contents]

State Server

One problem that you may face in using Web applications is the ability to maintain state between user clicks in the client browser. The Table Component maintains state by storing state information in hidden Form Elements.

However maintaining state with Anchors brings a different problem. Using a database as a back-end for a Web application is one method of maintaining state. Of course, for database activity, you may want to have the user login with a username and password for accountability and to control data access. However, you don't want the user to login on every click.

Using State Server Cookies

The following shows a design for maintaining login information in a generic way that can be used for maintaining the design state

In this method of maintaining state information, the information is passed to and from the browser using the HTML code that is sent to the browser for display. Part of the returning data from the browser is that same information.

The information can be sent explicitly, or else it can be sent by reference - the information passing to and from the HTML being just the ID number of a State Server cookie which is used to hold the real information. This latter technique might be more secure.

Remember that Sapphire/Web's State Server maintains numbered cookies, not named cookies.

HTML Cookies

You can send this number down to the user's browser with the template as a hidden variable before a server application finishes. The next invocation of the application will receive that number and will know to go and use it to get information from the State Server.

The diagram above illustrates an alternative way of keeping information with the cooperation of the browser. Instead of altering the HTML code to include a hidden variable that gets returned when the user presses a button - best used with forms - it uses a setting of the browser variable HTTP_COOKIE. On re-invocation, the server application can investigate this value and act appropriately.



[Top] [Prev] [Next] [Bottom] [Contents]

info@bluestone.com
Copyright © 1997, Bluestone. All rights reserved.